package com.imcode.mapdemo;

import java.util.Objects;

/**
 * 订单
 */
public class Order implements Comparable<Order> {
//public class Order {
    private String orderNumber;

    public Order(String orderNumber) {
        this.orderNumber = orderNumber;
    }

    public String getOrderNumber() {
        return orderNumber;
    }

    public void setOrderNumber(String orderNumber) {
        this.orderNumber = orderNumber;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Order)) return false;
        Order order = (Order) o;
        return Objects.equals(getOrderNumber(), order.getOrderNumber());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getOrderNumber());
    }
    @Override
    public int compareTo(Order o) {
        return this.orderNumber.compareTo(o.orderNumber);
    }
}
